﻿package com.thorqq.magictimer.core;

import java.io.Serializable;

import android.content.Context;



/**
 * @author THORQQ<br>
 * 数据库表： timeing_action
 */
public abstract class TAction implements Serializable
{
    private static final long serialVersionUID = -4061536221414749800L;
    
    protected int mID = -1;
    protected int mExecOrder = -1;
    protected String mActionType;
    protected String mParam = null;

    public TAction(int id, int execOrder, String actionType, String param)
    {
        mID = id;
        mExecOrder = execOrder;
        mActionType = actionType;
        mParam = param;
    }
    
    public abstract String getName();
    public abstract String getDescription();
    public abstract boolean parseStringParam();
    public abstract String paramToString();
    public abstract boolean run(Context context, TimerAbs timer);

    @Override
    public String toString()
    {
        StringBuffer sff = new StringBuffer();
        sff.append("mID=").append(mID).append(", ")
           .append("mExecOrder=").append(mExecOrder).append(", ")
           .append("mActionType=").append(mActionType).append(", ")
           .append("mParam=").append(mParam).append("")
           ;        
        return sff.toString();    
    }

    public int getID()
    {
        return mID;
    }
    
    public void setID(int id)
    {
        mID = id;
    }
 
    public int getExecOrder()
    {
        return mExecOrder;
    }

    public void setExecOrder(int execOrder)
    {
        mExecOrder = execOrder;
    }

    public String getActionType()
    {
        return mActionType;
    }
    
    public String getParam()
    {
        return this.paramToString();
    }
    
}
